﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Zocono.WCS.Infrastructure.ApllicationDto.DtoUser
{
    public class FunctionInfoDto 
    {

        /// <summary>
        /// 主键ID
        /// </summary>
        public long ID { get; set; }
        /// <summary>
        /// 前端js 溢出问题
        /// </summary>
        public string Js_Id { get { return ID.ToString(); } }
        /// <summary>
        /// 功能编号
        /// </summary>
        public string Code { get; set; }

        /// <summary>
        /// 功能名称
        /// </summary>
        public string FullName { get; set; }

        /// <summary>
        /// 界面URL
        /// </summary>
        public string URL { get; set; }

        /// <summary>
        /// 权限说明
        /// </summary>
        public string Description { get; set; }

        /// <summary>
        /// 操作选项
        /// </summary>
        public int Operation { get; set; }

        /// <summary>
        /// 菜单图标
        /// </summary>
        public int Symbol { get; set; }
        /// <summary>
        /// 上级菜单ID
        /// </summary>
        public long Pid { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string Js_Pid { get { return Pid.ToString(); } }
        /// <summary>
        /// 一级菜单图标
        /// </summary>
        public string MenuIcon { get; set; }
        /// <summary>
        /// 状态 1=启用，2=禁用，3=删除
        /// </summary>
        public int Status { get; set; }

        public List<ParentMenu> ParentMenus { get; set; }

        public  string PName { get { return ParentMenus.Where(l => l.Pid == Pid).Select(l => l.PidName).FirstOrDefault(); } }
    }

    public class ParentMenu
    {
        public long Pid { get; set; }

        public string PidName { get; set; }
    }
}
